package demo6Lianxi20250331;

public class Demo2 {
    public static void main(String[] args) {
        //java: Singleton() 在 demo6Lianxi20250331.Singleton 中是 private 访问控制
//        Singleton s1 = new Singleton();
//        Singleton s2 = new Singleton();

        Singleton s1 = Singleton.getInstance();
        Singleton s2 = Singleton.getInstance();

        System.out.println("s1:"+s1);
        System.out.println("s2:"+s2);

       // Student student = new Student();
        Student instance1 = Student.getInstance();
        Student instance2 = Student.getInstance();
        System.out.println("instance1:"+instance1);
        System.out.println("instance2:"+instance2);
    }
}
